Skip to content

Conversation

williasc
Copy link
Member

Closes #47

What was done

Focus and announcements. I stepped through every page and flow in the accessibility tree and fixed the places where focus was lost or nothing was announced:

  • Removing a filter chip, «Nullstill filtre» and the links when a search has no results: focus moves to the next chip or the h1.
  • Saving or deleting a review: focus goes back to the submit button, and «Laster vin …» is no longer announced while the page refreshes.
  • Failed login: focus stays on the button (aria-disabled instead of disabled).
  • Switching between «Logg inn» and «Lag bruker»: focus moves to the new h1, and the page title changes.
  • The password hint is now read with the field.
  • Removing a wine from «Vil prøve» on Mine anmeldelser: the change is announced, and focus moves to the list heading.
  • On the dev server, focus no longer jumps to the h1 on first load. React StrictMode caused this, and production did not do it.

VoiceOver, automated. npm run voiceover in frontend/ uses Guidepup to drive the real VoiceOver through 15 steps in WebKit, the engine in Safari. It writes what VoiceOver said to a report. The latest run: 11 of 15 steps passed. The 4 failures come from Safari's Tab behaviour and a script that is too strict, not from bugs in the app. Each one is explained in the doc.

Found with VoiceOver and fixed. Safari did not read lists without bullets as lists. All 11 now have role="list", and a test guards against new ones.

Where to find it

  • Report: docs/voiceover-report.md
  • Method, findings and the VoiceOver script: docs/screen-reader.md
  • Focus tests in a real browser, and axe on more pages: frontend/e2e/screenreader.spec.ts
  • The VoiceOver run: frontend/scripts/voiceover.mjs. The one-time setup is in the doc.
  • Unit tests: src/lib/focus.test.ts, src/test/listRoles.test.ts, and new focus tests in the search, review, account and Mine anmeldelser tests

Tested

  • npm run check passes.
  • Playwright: all the new tests pass. The 4 that fail on main are fixed in a separate PR.
  • npm run voiceover: 11 of 15 steps passed.

Not in this PR

  • A test by hand with VoiceOver in Safari.
  • VoiceOver reads empty required fields as «invalid data» before the user has typed anything. That fix is in progress separately.

@williasc williasc requested a review from manerlan November 16, 2026 22:52
@williasc williasc requested a review from a team as a code owner November 16, 2026 22:52
@williasc williasc linked an issue Nov 16, 2026 that may be closed by this pull request
williasc and others added 2 commits November 16, 2026 23:54
…eader

# Conflicts:
#	README.md
#	frontend/src/features/auth/components/AuthForm.tsx
#	frontend/src/features/wine/components/StudentReviews.tsx
@manerlan
Copy link
Member

Merged main into this branch to resolve the conflicts with #65 (reviews tied to user accounts). Since I pushed the merge, someone else needs to approve.

Resolved:

  • StudentReviews.tsx: kept both sides. The focus handling from this PR (formArea, focusIfLost) now wraps the review form, which is only shown when logged in. Visitors get the «Logg inn for å gi din dom» link from main.
  • AuthForm.tsx: took the version from main. Everything this PR added there (help text linked with aria-describedby, if (working) return, aria-disabled instead of disabled) is already in main's rewrite, which also links field errors and moves focus to the first one.
  • AccountPage.test.tsx: updated the expected help text in the new test to main's wording («bokstavene a–z … Store bokstaver blir små»), since capital letters are now allowed. The test checks the same thing as before.
  • README.md: kept both sides.

Tested: npx vitest run src/features/auth src/features/wine

If someone wants to make more changes run git pull before you continue on this branch.

# Conflicts:
#	frontend/src/features/search/SearchPage.test.tsx
Copy link
Member

@manerlan manerlan left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looked at, got a quick in person rundown. Report is good info to have. Approving

@manerlan manerlan merged commit e0397a0 into main Nov 18, 2026
@manerlan manerlan deleted the 47-implement-screen-reader branch November 18, 2026 10:20
Sign in to join this conversation on GitHub.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Implement screen reader
2 participants